package maze.app;

import maze.model.Map;
import maze.model.Pair;
import maze.view.Window;

import org.lwjgl.Sys;

public class Maze
{
	/** total unit */
	public static final float TOTAL_UNIT = 1100;

	/** blank unit */
	public static final float BLANK_UNIT = 50;

	/** maze size */
	public static final int MAZE_SIZE = 10;

	/** single unit */
	public static final float UNIT = (TOTAL_UNIT - 2 * BLANK_UNIT) / MAZE_SIZE;

	public static void main(String[] args)
	{
		// generate maze map
		Map map = Map.getInstance();
		map.size = new Pair(MAZE_SIZE, MAZE_SIZE);
		map.generate();
		map.display();

		// display maze window
		Window window = Window.getInstance();
		try
		{
			window.init();
			window.run();
		}
		catch (Exception e)
		{
			e.printStackTrace(System.err);
			Sys.alert(Window.TITLE, "An error occured and the game will exit.");
		}
		finally
		{
			window.cleanup();
		}
	}
}
